package com.hazz.kotlinmvp.api

import com.bybops.model.bean.*
import com.bybops.net.BaseResponse
import io.reactivex.Observable
import retrofit2.http.FieldMap
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST


/**
 * Created by xuhao on 2017/11/16.
 * Api 接口
 */

interface ApiService {


    //登录
    @FormUrlEncoded
    @POST("app/login")
    fun login(@FieldMap params: HashMap<String, String?>): Observable<BaseResponse<User>>

    //登出
    @FormUrlEncoded
    @POST("app/loginOut")
    fun loginOut(@FieldMap params: HashMap<String, String?>): Observable<BaseResponse<String>>

    //版本检测接口
    @FormUrlEncoded
    @POST("app/sys/checkUpdateInfo")
    fun checkUpdateInfo(@FieldMap params: HashMap<String, String?>): Observable<BaseResponse<CheckVersion>>

    //自动登录
    @FormUrlEncoded
    @POST("app/autoLogin")
    fun autoLogin(@FieldMap params: HashMap<String, String?>): Observable<BaseResponse<AutoLogin>>

    /*业务相关    工作列表*/
    @FormUrlEncoded
    @POST("app/equipment/getList")
    fun appEquipmentGetList(@FieldMap params: HashMap<String, String?>): Observable<BaseResponse<ArrayList<EquipmentList>>>

    /*根据barCode获取设备详情 */
    @FormUrlEncoded
    @POST("app/equipment/getDetailByBarCode")
    fun getDetailByBarCode(@FieldMap params: HashMap<String, String?>): Observable<BaseResponse<LockDetail>>

    /*新设备启用*/
    @FormUrlEncoded
    @POST("app/equipment/activeDevice")
    fun activeDevice(@FieldMap params: HashMap<String, String?>): Observable<BaseResponse<LockDetail>>

    /*设备信息获取*/
    @FormUrlEncoded
    @POST("app/equipment/getDetail")
    fun equipmentGetDetail(@FieldMap params: HashMap<String, String?>): Observable<BaseResponse<EquipmentList>>


    /*设备信息获取*/
    @FormUrlEncoded
    @POST("app/polling/addPoll")
    fun pollingAddPoll(@FieldMap params: HashMap<String, String?>): Observable<BaseResponse<String>>

    /*新增巡检记录*/
//    @FormUrlEncoded
//    @POST("app/polling/addPoll")
//    fun pollingAddPoll(@Query("equipSN") equipSN : String , @Query("access_token") access_token: String
//    ,@Query("barcode") barcode : String , @Query("energy") energy: String
//                       ,@Query("userKey") userKey : String , @Query("userName") userName: String
//                       ,@Query("hospital") hospital : String , @Query("hospitalId") hospitalId: String
//                       ,@Query("department") department : String , @Query("startequipStatus") startequipStatus: String
//                       ,@Query("endequipStatus") endequipStatus : String , @Query("faultTime") faultTime: String
//                       ,@Query("faultDes") faultDes : String , @Query("faultUrl") faultUrl: String
//                       ,@Query("pollTime") pollTime : String , @Query("pollUrl") pollUrl: String , @Query("pollDes") pollDes : String ): Observable<BaseResponse<String>>

}